/*
 ============================================================================
 Name		: NfcConnector.h
 Author	  : 
 Version	 : 
 Copyright   : 
 Description : CNfcConnector declaration
 ============================================================================
 */

#ifndef NFCCONNECTOR_H
#define NFCCONNECTOR_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>

#include <llcplinklistener.h>
#include <llcpconnorientedlistener.h>
#include <nfcserver.h>

class CLlcpProvider;
class MP2PMessageSupplier;
class CLlcpReceiveHandler;
class CLlcpSendHandler;
/**
 *  CNfcConnector
 * 
 */
class CNfcConnector : public CBase, private MLlcpLinkListener, private MLlcpConnOrientedListener
	{
public:
	// Constructors and destructor

	/**
	 * Destructor.
	 */
	~CNfcConnector();

	/**
	 * Two-phased constructor.
	 */
	static CNfcConnector* NewL(MP2PMessageSupplier* aMessageSupplier);

	/**
	 * Two-phased constructor.
	 */
	static CNfcConnector* NewLC(MP2PMessageSupplier* aMessageSupplier);
	
	/**
	 * Informs connector that client has data ready to be sent
	 */
	void ReadyToSend();
	
	void StartL();
	void Stop();

private:

	/**
	 * Constructor for performing 1st stage construction
	 */
	CNfcConnector(MP2PMessageSupplier* aMessageSupplier);

	/**
	 * EPOC default constructor for performing 2nd stage construction
	 */
	void ConstructL();
	
	/**
	 * MLlcpLinkListener implementation
	 */
	void LlcpRemoteFound();
    void LlcpRemoteLost();
	
	/**
	 * MLlcpConnOrientedListener implementation
	 */
    void RemoteConnectRequest( MLlcpConnOrientedTransporter* aConnection );
    
    void Cleanup();

	TBool iStarted;
	
	MP2PMessageSupplier& iMessageSupplier;
	RNfcServer iNfcServer;
	CLlcpProvider* iLlcp;
	CLlcpSendHandler* iSender;
	CLlcpReceiveHandler* iReceiver;

	};

#endif // NFCCONNECTOR_H
